//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2022 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

import Foundation
import SotoCore

extension Detective {
    // MARK: Enums

    public enum DatasourcePackage: String, CustomStringConvertible, Codable, _SotoSendable {
        case detectiveCore = "DETECTIVE_CORE"
        case eksAudit = "EKS_AUDIT"
        public var description: String { return self.rawValue }
    }

    public enum DatasourcePackageIngestState: String, CustomStringConvertible, Codable, _SotoSendable {
        case disabled = "DISABLED"
        case started = "STARTED"
        case stopped = "STOPPED"
        public var description: String { return self.rawValue }
    }

    public enum InvitationType: String, CustomStringConvertible, Codable, _SotoSendable {
        case invitation = "INVITATION"
        case organization = "ORGANIZATION"
        public var description: String { return self.rawValue }
    }

    public enum MemberDisabledReason: String, CustomStringConvertible, Codable, _SotoSendable {
        case volumeTooHigh = "VOLUME_TOO_HIGH"
        case volumeUnknown = "VOLUME_UNKNOWN"
        public var description: String { return self.rawValue }
    }

    public enum MemberStatus: String, CustomStringConvertible, Codable, _SotoSendable {
        case acceptedButDisabled = "ACCEPTED_BUT_DISABLED"
        case enabled = "ENABLED"
        case invited = "INVITED"
        case verificationFailed = "VERIFICATION_FAILED"
        case verificationInProgress = "VERIFICATION_IN_PROGRESS"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct AcceptInvitationRequest: AWSEncodableShape {
        /// The ARN of the behavior graph that the member account is accepting the invitation for. The member account status in the behavior graph must be INVITED.
        public let graphArn: String

        public init(graphArn: String) {
            self.graphArn = graphArn
        }

        public func validate(name: String) throws {
            try self.validate(self.graphArn, name: "graphArn", parent: name, pattern: "^arn:aws[-\\w]{0,10}?:detective:[-\\w]{2,20}?:\\d{12}?:graph:[abcdef\\d]{32}?$")
        }

        private enum CodingKeys: String, CodingKey {
            case graphArn = "GraphArn"
        }
    }

    public struct Account: AWSEncodableShape {
        /// The account identifier of the Amazon Web Services account.
        public let accountId: String
        /// The Amazon Web Services account root user email address for the Amazon Web Services account.
        public let emailAddress: String

        public init(accountId: String, emailAddress: String) {
            self.accountId = accountId
            self.emailAddress = emailAddress
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, max: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, min: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "^[0-9]+$")
            try self.validate(self.emailAddress, name: "emailAddress", parent: name, max: 64)
            try self.validate(self.emailAddress, name: "emailAddress", parent: name, min: 1)
            try self.validate(self.emailAddress, name: "emailAddress", parent: name, pattern: "^.+@(?:(?:(?!-)[A-Za-z0-9-]{1,62})?[A-Za-z0-9]{1}\\.)+[A-Za-z]{2,6}$")
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case emailAddress = "EmailAddress"
        }
    }

    public struct Administrator: AWSDecodableShape {
        /// The Amazon Web Services account identifier of the Detective administrator account for the organization.
        public let accountId: String?
        /// The date and time when the Detective administrator account was enabled. The value is an ISO8601 formatted string. For example, 2021-08-18T16:35:56.284Z.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var delegationTime: Date?
        /// The ARN of the organization behavior graph.
        public let graphArn: String?

        public init(accountId: String? = nil, delegationTime: Date? = nil, graphArn: String? = nil) {
            self.accountId = accountId
            self.delegationTime = delegationTime
            self.graphArn = graphArn
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case delegationTime = "DelegationTime"
            case graphArn = "GraphArn"
        }
    }

    public struct BatchGetGraphMemberDatasourcesRequest: AWSEncodableShape {
        /// The list of Amazon Web Services accounts to get data source package information on.
        public let accountIds: [String]
        /// The ARN of the behavior graph.
        public let graphArn: String

        public init(accountIds: [String], graphArn: String) {
            self.accountIds = accountIds
            self.graphArn = graphArn
        }

        public func validate(name: String) throws {
            try self.accountIds.forEach {
                try validate($0, name: "accountIds[]", parent: name, max: 12)
                try validate($0, name: "accountIds[]", parent: name, min: 12)
                try validate($0, name: "accountIds[]", parent: name, pattern: "^[0-9]+$")
            }
            try self.validate(self.accountIds, name: "accountIds", parent: name, max: 200)
            try self.validate(self.accountIds, name: "accountIds", parent: name, min: 1)
            try self.validate(self.graphArn, name: "graphArn", parent: name, pattern: "^arn:aws[-\\w]{0,10}?:detective:[-\\w]{2,20}?:\\d{12}?:graph:[abcdef\\d]{32}?$")
        }

        private enum CodingKeys: String, CodingKey {
            case accountIds = "AccountIds"
            case graphArn = "GraphArn"
        }
    }

    public struct BatchGetGraphMemberDatasourcesResponse: AWSDecodableShape {
        /// Details on the status of data source packages for members of the behavior graph.
        public let memberDatasources: [MembershipDatasources]?
        /// Accounts that data source package information could not be retrieved for.
        public let unprocessedAccounts: [UnprocessedAccount]?

        public init(memberDatasources: [MembershipDatasources]? = nil, unprocessedAccounts: [UnprocessedAccount]? = nil) {
            self.memberDatasources = memberDatasources
            self.unprocessedAccounts = unprocessedAccounts
        }

        private enum CodingKeys: String, CodingKey {
            case memberDatasources = "MemberDatasources"
            case unprocessedAccounts = "UnprocessedAccounts"
        }
    }

    public struct BatchGetMembershipDatasourcesRequest: AWSEncodableShape {
        /// The ARN of the behavior graph.
        public let graphArns: [String]

        public init(graphArns: [String]) {
            self.graphArns = graphArns
        }

        public func validate(name: String) throws {
            try self.graphArns.forEach {
                try validate($0, name: "graphArns[]", parent: name, pattern: "^arn:aws[-\\w]{0,10}?:detective:[-\\w]{2,20}?:\\d{12}?:graph:[abcdef\\d]{32}?$")
            }
            try self.validate(self.graphArns, name: "graphArns", parent: name, max: 50)
            try self.validate(self.graphArns, name: "graphArns", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case graphArns = "GraphArns"
        }
    }

    public struct BatchGetMembershipDatasourcesResponse: AWSDecodableShape {
        /// Details on the data source package history for an member of the behavior graph.
        public let membershipDatasources: [MembershipDatasources]?
        /// Graphs that data source package information could not be retrieved for.
        public let unprocessedGraphs: [UnprocessedGraph]?

        public init(membershipDatasources: [MembershipDatasources]? = nil, unprocessedGraphs: [UnprocessedGraph]? = nil) {
            self.membershipDatasources = membershipDatasources
            self.unprocessedGraphs = unprocessedGraphs
        }

        private enum CodingKeys: String, CodingKey {
            case membershipDatasources = "MembershipDatasources"
            case unprocessedGraphs = "UnprocessedGraphs"
        }
    }

    public struct CreateGraphRequest: AWSEncodableShape {
        /// The tags to assign to the new behavior graph. You can add up to 50 tags. For each tag, you provide the tag key and the tag value. Each tag key can contain up to 128 characters. Each tag value can contain up to 256 characters.
        public let tags: [String: String]?

        public init(tags: [String: String]? = nil) {
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.tags?.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.key, name: "tags.key", parent: name, pattern: "^(?!aws:)[a-zA-Z+-=._:/]+$")
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 50)
            try self.validate(self.tags, name: "tags", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case tags = "Tags"
        }
    }

    public struct CreateGraphResponse: AWSDecodableShape {
        /// The ARN of the new behavior graph.
        public let graphArn: String?

        public init(graphArn: String? = nil) {
            self.graphArn = graphArn
        }

        private enum CodingKeys: String, CodingKey {
            case graphArn = "GraphArn"
        }
    }

    public struct CreateMembersRequest: AWSEncodableShape {
        /// The list of Amazon Web Services accounts to invite or to enable. You can invite or enable up to 50 accounts at a time. For each invited account, the account list contains the account identifier and the Amazon Web Services account root user email address. For organization accounts in the organization behavior graph, the email address is not required.
        public let accounts: [Account]
        /// if set to true, then the invited accounts do not receive email notifications. By default, this is set to false, and the invited accounts receive email notifications. Organization accounts in the organization behavior graph do not receive email notifications.
        public let disableEmailNotification: Bool?
        /// The ARN of the behavior graph.
        public let graphArn: String
        /// Customized message text to include in the invitation email message to the invited member accounts.
        public let message: String?

        public init(accounts: [Account], disableEmailNotification: Bool? = nil, graphArn: String, message: String? = nil) {
            self.accounts = accounts
            self.disableEmailNotification = disableEmailNotification
            self.graphArn = graphArn
            self.message = message
        }

        public func validate(name: String) throws {
            try self.accounts.forEach {
                try $0.validate(name: "\(name).accounts[]")
            }
            try self.validate(self.accounts, name: "accounts", parent: name, max: 50)
            try self.validate(self.accounts, name: "accounts", parent: name, min: 1)
            try self.validate(self.graphArn, name: "graphArn", parent: name, pattern: "^arn:aws[-\\w]{0,10}?:detective:[-\\w]{2,20}?:\\d{12}?:graph:[abcdef\\d]{32}?$")
            try self.validate(self.message, name: "message", parent: name, max: 1000)
            try self.validate(self.message, name: "message", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case accounts = "Accounts"
            case disableEmailNotification = "DisableEmailNotification"
            case graphArn = "GraphArn"
            case message = "Message"
        }
    }

    public struct CreateMembersResponse: AWSDecodableShape {
        /// The set of member account invitation or enablement requests that Detective was able to process. This includes accounts that are being verified, that failed verification, and that passed verification and are being sent an invitation or are being enabled.
        public let members: [MemberDetail]?
        /// The list of accounts for which Detective was unable to process the invitation or enablement request. For each account, the list provides the reason why the request could not be processed. The list includes accounts that are already member accounts in the behavior graph.
        public let unprocessedAccounts: [UnprocessedAccount]?

        public init(members: [MemberDetail]? = nil, unprocessedAccounts: [UnprocessedAccount]? = nil) {
            self.members = members
            self.unprocessedAccounts = unprocessedAccounts
        }

        private enum CodingKeys: String, CodingKey {
            case members = "Members"
            case unprocessedAccounts = "UnprocessedAccounts"
        }
    }

    public struct DatasourcePackageIngestDetail: AWSDecodableShape {
        /// Details on which data source packages are ingested for a member account.
        public let datasourcePackageIngestState: DatasourcePackageIngestState?
        /// The date a data source package was enabled for this account
        public let lastIngestStateChange: [DatasourcePackageIngestState: TimestampForCollection]?

        public init(datasourcePackageIngestState: DatasourcePackageIngestState? = nil, lastIngestStateChange: [DatasourcePackageIngestState: TimestampForCollection]? = nil) {
            self.datasourcePackageIngestState = datasourcePackageIngestState
            self.lastIngestStateChange = lastIngestStateChange
        }

        private enum CodingKeys: String, CodingKey {
            case datasourcePackageIngestState = "DatasourcePackageIngestState"
            case lastIngestStateChange = "LastIngestStateChange"
        }
    }

    public struct DatasourcePackageUsageInfo: AWSDecodableShape {
        /// Total volume of data in bytes per day ingested for a given data source package.
        public let volumeUsageInBytes: Int64?
        /// The data and time when the member account data volume was last updated. The value is an ISO8601 formatted string. For example, 2021-08-18T16:35:56.284Z.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var volumeUsageUpdateTime: Date?

        public init(volumeUsageInBytes: Int64? = nil, volumeUsageUpdateTime: Date? = nil) {
            self.volumeUsageInBytes = volumeUsageInBytes
            self.volumeUsageUpdateTime = volumeUsageUpdateTime
        }

        private enum CodingKeys: String, CodingKey {
            case volumeUsageInBytes = "VolumeUsageInBytes"
            case volumeUsageUpdateTime = "VolumeUsageUpdateTime"
        }
    }

    public struct DeleteGraphRequest: AWSEncodableShape {
        /// The ARN of the behavior graph to disable.
        public let graphArn: String

        public init(graphArn: String) {
            self.graphArn = graphArn
        }

        public func validate(name: String) throws {
            try self.validate(self.graphArn, name: "graphArn", parent: name, pattern: "^arn:aws[-\\w]{0,10}?:detective:[-\\w]{2,20}?:\\d{12}?:graph:[abcdef\\d]{32}?$")
        }

        private enum CodingKeys: String, CodingKey {
            case graphArn = "GraphArn"
        }
    }

    public struct DeleteMembersRequest: AWSEncodableShape {
        /// The list of Amazon Web Services account identifiers for the member accounts to remove from the behavior graph. You can remove up to 50 member accounts at a time.
        public let accountIds: [String]
        /// The ARN of the behavior graph to remove members from.
        public let graphArn: String

        public init(accountIds: [String], graphArn: String) {
            self.accountIds = accountIds
            self.graphArn = graphArn
        }

        public func validate(name: String) throws {
            try self.accountIds.forEach {
                try validate($0, name: "accountIds[]", parent: name, max: 12)
                try validate($0, name: "accountIds[]", parent: name, min: 12)
                try validate($0, name: "accountIds[]", parent: name, pattern: "^[0-9]+$")
            }
            try self.validate(self.accountIds, name: "accountIds", parent: name, max: 50)
            try self.validate(self.accountIds, name: "accountIds", parent: name, min: 1)
            try self.validate(self.graphArn, name: "graphArn", parent: name, pattern: "^arn:aws[-\\w]{0,10}?:detective:[-\\w]{2,20}?:\\d{12}?:graph:[abcdef\\d]{32}?$")
        }

        private enum CodingKeys: String, CodingKey {
            case accountIds = "AccountIds"
            case graphArn = "GraphArn"
        }
    }

    public struct DeleteMembersResponse: AWSDecodableShape {
        /// The list of Amazon Web Services account identifiers for the member accounts that Detective successfully removed from the behavior graph.
        public let accountIds: [String]?
        /// The list of member accounts that Detective was not able to remove from the behavior graph. For each member account, provides the reason that the deletion could not be processed.
        public let unprocessedAccounts: [UnprocessedAccount]?

        public init(accountIds: [String]? = nil, unprocessedAccounts: [UnprocessedAccount]? = nil) {
            self.accountIds = accountIds
            self.unprocessedAccounts = unprocessedAccounts
        }

        private enum CodingKeys: String, CodingKey {
            case accountIds = "AccountIds"
            case unprocessedAccounts = "UnprocessedAccounts"
        }
    }

    public struct DescribeOrganizationConfigurationRequest: AWSEncodableShape {
        /// The ARN of the organization behavior graph.
        public let graphArn: String

        public init(graphArn: String) {
            self.graphArn = graphArn
        }

        public func validate(name: String) throws {
            try self.validate(self.graphArn, name: "graphArn", parent: name, pattern: "^arn:aws[-\\w]{0,10}?:detective:[-\\w]{2,20}?:\\d{12}?:graph:[abcdef\\d]{32}?$")
        }

        private enum CodingKeys: String, CodingKey {
            case graphArn = "GraphArn"
        }
    }

    public struct DescribeOrganizationConfigurationResponse: AWSDecodableShape {
        /// Indicates whether to automatically enable new organization accounts as member accounts in the organization behavior graph.
        public let autoEnable: Bool?

        public init(autoEnable: Bool? = nil) {
            self.autoEnable = autoEnable
        }

        private enum CodingKeys: String, CodingKey {
            case autoEnable = "AutoEnable"
        }
    }

    public struct DisassociateMembershipRequest: AWSEncodableShape {
        /// The ARN of the behavior graph to remove the member account from. The member account's member status in the behavior graph must be ENABLED.
        public let graphArn: String

        public init(graphArn: String) {
            self.graphArn = graphArn
        }

        public func validate(name: String) throws {
            try self.validate(self.graphArn, name: "graphArn", parent: name, pattern: "^arn:aws[-\\w]{0,10}?:detective:[-\\w]{2,20}?:\\d{12}?:graph:[abcdef\\d]{32}?$")
        }

        private enum CodingKeys: String, CodingKey {
            case graphArn = "GraphArn"
        }
    }

    public struct EnableOrganizationAdminAccountRequest: AWSEncodableShape {
        /// The Amazon Web Services account identifier of the account to designate as the Detective administrator account for the organization.
        public let accountId: String

        public init(accountId: String) {
            self.accountId = accountId
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, max: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, min: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "^[0-9]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
        }
    }

    public struct GetMembersRequest: AWSEncodableShape {
        /// The list of Amazon Web Services account identifiers for the member account for which to return member details. You can request details for up to 50 member accounts at a time. You cannot use GetMembers to retrieve information about member accounts that were removed from the behavior graph.
        public let accountIds: [String]
        /// The ARN of the behavior graph for which to request the member details.
        public let graphArn: String

        public init(accountIds: [String], graphArn: String) {
            self.accountIds = accountIds
            self.graphArn = graphArn
        }

        public func validate(name: String) throws {
            try self.accountIds.forEach {
                try validate($0, name: "accountIds[]", parent: name, max: 12)
                try validate($0, name: "accountIds[]", parent: name, min: 12)
                try validate($0, name: "accountIds[]", parent: name, pattern: "^[0-9]+$")
            }
            try self.validate(self.accountIds, name: "accountIds", parent: name, max: 50)
            try self.validate(self.accountIds, name: "accountIds", parent: name, min: 1)
            try self.validate(self.graphArn, name: "graphArn", parent: name, pattern: "^arn:aws[-\\w]{0,10}?:detective:[-\\w]{2,20}?:\\d{12}?:graph:[abcdef\\d]{32}?$")
        }

        private enum CodingKeys: String, CodingKey {
            case accountIds = "AccountIds"
            case graphArn = "GraphArn"
        }
    }

    public struct GetMembersResponse: AWSDecodableShape {
        /// The member account details that Detective is returning in response to the request.
        public let memberDetails: [MemberDetail]?
        /// The requested member accounts for which Detective was unable to return member details. For each account, provides the reason why the request could not be processed.
        public let unprocessedAccounts: [UnprocessedAccount]?

        public init(memberDetails: [MemberDetail]? = nil, unprocessedAccounts: [UnprocessedAccount]? = nil) {
            self.memberDetails = memberDetails
            self.unprocessedAccounts = unprocessedAccounts
        }

        private enum CodingKeys: String, CodingKey {
            case memberDetails = "MemberDetails"
            case unprocessedAccounts = "UnprocessedAccounts"
        }
    }

    public struct Graph: AWSDecodableShape {
        /// The ARN of the behavior graph.
        public let arn: String?
        /// The date and time that the behavior graph was created. The value is an ISO8601 formatted string. For example, 2021-08-18T16:35:56.284Z.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var createdTime: Date?

        public init(arn: String? = nil, createdTime: Date? = nil) {
            self.arn = arn
            self.createdTime = createdTime
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case createdTime = "CreatedTime"
        }
    }

    public struct ListDatasourcePackagesRequest: AWSEncodableShape {
        /// The ARN of the behavior graph.
        public let graphArn: String
        /// The maximum number of results to return.
        public let maxResults: Int?
        /// For requests to get the next page of results, the pagination token that was returned with the previous set of results. The initial request does not include a pagination token.
        public let nextToken: String?

        public init(graphArn: String, maxResults: Int? = nil, nextToken: String? = nil) {
            self.graphArn = graphArn
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.graphArn, name: "graphArn", parent: name, pattern: "^arn:aws[-\\w]{0,10}?:detective:[-\\w]{2,20}?:\\d{12}?:graph:[abcdef\\d]{32}?$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 200)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case graphArn = "GraphArn"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListDatasourcePackagesResponse: AWSDecodableShape {
        /// Details on the data source packages active in the behavior graph.
        public let datasourcePackages: [DatasourcePackage: DatasourcePackageIngestDetail]?
        /// For requests to get the next page of results, the pagination token that was returned with the previous set of results. The initial request does not include a pagination token.
        public let nextToken: String?

        public init(datasourcePackages: [DatasourcePackage: DatasourcePackageIngestDetail]? = nil, nextToken: String? = nil) {
            self.datasourcePackages = datasourcePackages
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case datasourcePackages = "DatasourcePackages"
            case nextToken = "NextToken"
        }
    }

    public struct ListGraphsRequest: AWSEncodableShape {
        /// The maximum number of graphs to return at a time. The total must be less than the overall limit on the number of results to return, which is currently 200.
        public let maxResults: Int?
        /// For requests to get the next page of results, the pagination token that was returned with the previous set of results. The initial request does not include a pagination token.
        public let nextToken: String?

        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 200)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListGraphsResponse: AWSDecodableShape {
        /// A list of behavior graphs that the account is an administrator account for.
        public let graphList: [Graph]?
        /// If there are more behavior graphs remaining in the results, then this is the pagination token to use to request the next page of behavior graphs.
        public let nextToken: String?

        public init(graphList: [Graph]? = nil, nextToken: String? = nil) {
            self.graphList = graphList
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case graphList = "GraphList"
            case nextToken = "NextToken"
        }
    }

    public struct ListInvitationsRequest: AWSEncodableShape {
        /// The maximum number of behavior graph invitations to return in the response. The total must be less than the overall limit on the number of results to return, which is currently 200.
        public let maxResults: Int?
        /// For requests to retrieve the next page of results, the pagination token that was returned with the previous page of results. The initial request does not include a pagination token.
        public let nextToken: String?

        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 200)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListInvitationsResponse: AWSDecodableShape {
        /// The list of behavior graphs for which the member account has open or accepted invitations.
        public let invitations: [MemberDetail]?
        /// If there are more behavior graphs remaining in the results, then this is the pagination token to use to request the next page of behavior graphs.
        public let nextToken: String?

        public init(invitations: [MemberDetail]? = nil, nextToken: String? = nil) {
            self.invitations = invitations
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case invitations = "Invitations"
            case nextToken = "NextToken"
        }
    }

    public struct ListMembersRequest: AWSEncodableShape {
        /// The ARN of the behavior graph for which to retrieve the list of member accounts.
        public let graphArn: String
        /// The maximum number of member accounts to include in the response. The total must be less than the overall limit on the number of results to return, which is currently 200.
        public let maxResults: Int?
        /// For requests to retrieve the next page of member account results, the pagination token that was returned with the previous page of results. The initial request does not include a pagination token.
        public let nextToken: String?

        public init(graphArn: String, maxResults: Int? = nil, nextToken: String? = nil) {
            self.graphArn = graphArn
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.graphArn, name: "graphArn", parent: name, pattern: "^arn:aws[-\\w]{0,10}?:detective:[-\\w]{2,20}?:\\d{12}?:graph:[abcdef\\d]{32}?$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 200)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case graphArn = "GraphArn"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListMembersResponse: AWSDecodableShape {
        /// The list of member accounts in the behavior graph. For invited accounts, the results include member accounts that did not pass verification and member accounts that have not yet accepted the invitation to the behavior graph. The results do not include member accounts that were removed from the behavior graph. For the organization behavior graph, the results do not include organization accounts that the Detective administrator account has not enabled as member accounts.
        public let memberDetails: [MemberDetail]?
        /// If there are more member accounts remaining in the results, then use this pagination token to request the next page of member accounts.
        public let nextToken: String?

        public init(memberDetails: [MemberDetail]? = nil, nextToken: String? = nil) {
            self.memberDetails = memberDetails
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case memberDetails = "MemberDetails"
            case nextToken = "NextToken"
        }
    }

    public struct ListOrganizationAdminAccountsRequest: AWSEncodableShape {
        /// The maximum number of results to return.
        public let maxResults: Int?
        /// For requests to get the next page of results, the pagination token that was returned with the previous set of results. The initial request does not include a pagination token.
        public let nextToken: String?

        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 200)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListOrganizationAdminAccountsResponse: AWSDecodableShape {
        /// The list of Detective administrator accounts.
        public let administrators: [Administrator]?
        /// If there are more accounts remaining in the results, then this is the pagination token to use to request the next page of accounts.
        public let nextToken: String?

        public init(administrators: [Administrator]? = nil, nextToken: String? = nil) {
            self.administrators = administrators
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case administrators = "Administrators"
            case nextToken = "NextToken"
        }
    }

    public struct ListTagsForResourceRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "resourceArn", location: .uri("ResourceArn"))
        ]

        /// The ARN of the behavior graph for which to retrieve the tag values.
        public let resourceArn: String

        public init(resourceArn: String) {
            self.resourceArn = resourceArn
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:aws[-\\w]{0,10}?:detective:[-\\w]{2,20}?:\\d{12}?:graph:[abcdef\\d]{32}?$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListTagsForResourceResponse: AWSDecodableShape {
        /// The tag values that are assigned to the behavior graph. The request returns up to 50 tag values.
        public let tags: [String: String]?

        public init(tags: [String: String]? = nil) {
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case tags = "Tags"
        }
    }

    public struct MemberDetail: AWSDecodableShape {
        /// The Amazon Web Services account identifier for the member account.
        public let accountId: String?
        /// The Amazon Web Services account identifier of the administrator account for the behavior graph.
        public let administratorId: String?
        /// The state of a data source package for the behavior graph.
        public let datasourcePackageIngestStates: [DatasourcePackage: DatasourcePackageIngestState]?
        /// For member accounts with a status of ACCEPTED_BUT_DISABLED, the reason that the member account is not enabled. The reason can have one of the following values:    VOLUME_TOO_HIGH - Indicates that adding the member account would cause the data volume for the behavior graph to be too high.    VOLUME_UNKNOWN - Indicates that Detective is unable to verify the data volume for the member account. This is usually because the member account is not enrolled in Amazon GuardDuty.
        public let disabledReason: MemberDisabledReason?
        /// The Amazon Web Services account root user email address for the member account.
        public let emailAddress: String?
        /// The ARN of the behavior graph.
        public let graphArn: String?
        /// The type of behavior graph membership. For an organization account in the organization behavior graph, the type is ORGANIZATION. For an account that was invited to a behavior graph, the type is INVITATION.
        public let invitationType: InvitationType?
        /// For invited accounts, the date and time that Detective sent the invitation to the account. The value is an ISO8601 formatted string. For example, 2021-08-18T16:35:56.284Z.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var invitedTime: Date?
        /// The Amazon Web Services account identifier of the administrator account for the behavior graph.
        public let masterId: String?
        /// The member account data volume as a percentage of the maximum allowed data volume. 0 indicates 0 percent, and 100 indicates 100 percent. Note that this is not the percentage of the behavior graph data volume. For example, the data volume for the behavior graph is 80 GB per day. The maximum data volume is 160 GB per day. If the data volume for the member account is 40 GB per day, then PercentOfGraphUtilization is 25. It represents 25% of the maximum allowed data volume.
        public let percentOfGraphUtilization: Double?
        /// The date and time when the graph utilization percentage was last updated. The value is an ISO8601 formatted string. For example, 2021-08-18T16:35:56.284Z.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var percentOfGraphUtilizationUpdatedTime: Date?
        /// The current membership status of the member account. The status can have one of the following values:    INVITED - For invited accounts only. Indicates that the member was sent an invitation but has not yet responded.    VERIFICATION_IN_PROGRESS - For invited accounts only, indicates that Detective is verifying that the account identifier and email address provided for the member account match. If they do match, then Detective sends the invitation. If the email address and account identifier don't match, then the member cannot be added to the behavior graph. For organization accounts in the organization behavior graph, indicates that Detective is verifying that the account belongs to the organization.    VERIFICATION_FAILED - For invited accounts only. Indicates that the account and email address provided for the member account do not match, and Detective did not send an invitation to the account.    ENABLED - Indicates that the member account currently contributes data to the behavior graph. For invited accounts, the member account accepted the invitation. For organization accounts in the organization behavior graph, the Detective administrator account enabled the organization account as a member account.    ACCEPTED_BUT_DISABLED - The account accepted the invitation, or was enabled by the Detective administrator account, but is prevented from contributing data to the behavior graph. DisabledReason provides the reason why the member account is not enabled.   Invited accounts that declined an invitation or that were removed from the behavior graph are not included. In the organization behavior graph, organization accounts that the Detective administrator account did not enable are not included.
        public let status: MemberStatus?
        /// The date and time that the member account was last updated. The value is an ISO8601 formatted string. For example, 2021-08-18T16:35:56.284Z.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var updatedTime: Date?
        /// Details on the volume of usage for each data source package in a behavior graph.
        public let volumeUsageByDatasourcePackage: [DatasourcePackage: DatasourcePackageUsageInfo]?
        /// The data volume in bytes per day for the member account.
        public let volumeUsageInBytes: Int64?
        /// The data and time when the member account data volume was last updated. The value is an ISO8601 formatted string. For example, 2021-08-18T16:35:56.284Z.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var volumeUsageUpdatedTime: Date?

        public init(accountId: String? = nil, administratorId: String? = nil, datasourcePackageIngestStates: [DatasourcePackage: DatasourcePackageIngestState]? = nil, disabledReason: MemberDisabledReason? = nil, emailAddress: String? = nil, graphArn: String? = nil, invitationType: InvitationType? = nil, invitedTime: Date? = nil, status: MemberStatus? = nil, updatedTime: Date? = nil, volumeUsageByDatasourcePackage: [DatasourcePackage: DatasourcePackageUsageInfo]? = nil) {
            self.accountId = accountId
            self.administratorId = administratorId
            self.datasourcePackageIngestStates = datasourcePackageIngestStates
            self.disabledReason = disabledReason
            self.emailAddress = emailAddress
            self.graphArn = graphArn
            self.invitationType = invitationType
            self.invitedTime = invitedTime
            self.masterId = nil
            self.percentOfGraphUtilization = nil
            self.percentOfGraphUtilizationUpdatedTime = nil
            self.status = status
            self.updatedTime = updatedTime
            self.volumeUsageByDatasourcePackage = volumeUsageByDatasourcePackage
            self.volumeUsageInBytes = nil
            self.volumeUsageUpdatedTime = nil
        }

        @available(*, deprecated, message: "Members masterId, percentOfGraphUtilization, percentOfGraphUtilizationUpdatedTime, volumeUsageInBytes, volumeUsageUpdatedTime have been deprecated")
        public init(accountId: String? = nil, administratorId: String? = nil, datasourcePackageIngestStates: [DatasourcePackage: DatasourcePackageIngestState]? = nil, disabledReason: MemberDisabledReason? = nil, emailAddress: String? = nil, graphArn: String? = nil, invitationType: InvitationType? = nil, invitedTime: Date? = nil, masterId: String? = nil, percentOfGraphUtilization: Double? = nil, percentOfGraphUtilizationUpdatedTime: Date? = nil, status: MemberStatus? = nil, updatedTime: Date? = nil, volumeUsageByDatasourcePackage: [DatasourcePackage: DatasourcePackageUsageInfo]? = nil, volumeUsageInBytes: Int64? = nil, volumeUsageUpdatedTime: Date? = nil) {
            self.accountId = accountId
            self.administratorId = administratorId
            self.datasourcePackageIngestStates = datasourcePackageIngestStates
            self.disabledReason = disabledReason
            self.emailAddress = emailAddress
            self.graphArn = graphArn
            self.invitationType = invitationType
            self.invitedTime = invitedTime
            self.masterId = masterId
            self.percentOfGraphUtilization = percentOfGraphUtilization
            self.percentOfGraphUtilizationUpdatedTime = percentOfGraphUtilizationUpdatedTime
            self.status = status
            self.updatedTime = updatedTime
            self.volumeUsageByDatasourcePackage = volumeUsageByDatasourcePackage
            self.volumeUsageInBytes = volumeUsageInBytes
            self.volumeUsageUpdatedTime = volumeUsageUpdatedTime
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case administratorId = "AdministratorId"
            case datasourcePackageIngestStates = "DatasourcePackageIngestStates"
            case disabledReason = "DisabledReason"
            case emailAddress = "EmailAddress"
            case graphArn = "GraphArn"
            case invitationType = "InvitationType"
            case invitedTime = "InvitedTime"
            case masterId = "MasterId"
            case percentOfGraphUtilization = "PercentOfGraphUtilization"
            case percentOfGraphUtilizationUpdatedTime = "PercentOfGraphUtilizationUpdatedTime"
            case status = "Status"
            case updatedTime = "UpdatedTime"
            case volumeUsageByDatasourcePackage = "VolumeUsageByDatasourcePackage"
            case volumeUsageInBytes = "VolumeUsageInBytes"
            case volumeUsageUpdatedTime = "VolumeUsageUpdatedTime"
        }
    }

    public struct MembershipDatasources: AWSDecodableShape {
        /// The account identifier of the Amazon Web Services account.
        public let accountId: String?
        /// Details on when a data source package was added to a behavior graph.
        public let datasourcePackageIngestHistory: [DatasourcePackage: [DatasourcePackageIngestState: TimestampForCollection]]?
        /// The ARN of the organization behavior graph.
        public let graphArn: String?

        public init(accountId: String? = nil, datasourcePackageIngestHistory: [DatasourcePackage: [DatasourcePackageIngestState: TimestampForCollection]]? = nil, graphArn: String? = nil) {
            self.accountId = accountId
            self.datasourcePackageIngestHistory = datasourcePackageIngestHistory
            self.graphArn = graphArn
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case datasourcePackageIngestHistory = "DatasourcePackageIngestHistory"
            case graphArn = "GraphArn"
        }
    }

    public struct RejectInvitationRequest: AWSEncodableShape {
        /// The ARN of the behavior graph to reject the invitation to. The member account's current member status in the behavior graph must be INVITED.
        public let graphArn: String

        public init(graphArn: String) {
            self.graphArn = graphArn
        }

        public func validate(name: String) throws {
            try self.validate(self.graphArn, name: "graphArn", parent: name, pattern: "^arn:aws[-\\w]{0,10}?:detective:[-\\w]{2,20}?:\\d{12}?:graph:[abcdef\\d]{32}?$")
        }

        private enum CodingKeys: String, CodingKey {
            case graphArn = "GraphArn"
        }
    }

    public struct StartMonitoringMemberRequest: AWSEncodableShape {
        /// The account ID of the member account to try to enable. The account must be an invited member account with a status of ACCEPTED_BUT_DISABLED.
        public let accountId: String
        /// The ARN of the behavior graph.
        public let graphArn: String

        public init(accountId: String, graphArn: String) {
            self.accountId = accountId
            self.graphArn = graphArn
        }

        public func validate(name: String) throws {
            try self.validate(self.accountId, name: "accountId", parent: name, max: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, min: 12)
            try self.validate(self.accountId, name: "accountId", parent: name, pattern: "^[0-9]+$")
            try self.validate(self.graphArn, name: "graphArn", parent: name, pattern: "^arn:aws[-\\w]{0,10}?:detective:[-\\w]{2,20}?:\\d{12}?:graph:[abcdef\\d]{32}?$")
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case graphArn = "GraphArn"
        }
    }

    public struct TagResourceRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "resourceArn", location: .uri("ResourceArn"))
        ]

        /// The ARN of the behavior graph to assign the tags to.
        public let resourceArn: String
        /// The tags to assign to the behavior graph. You can add up to 50 tags. For each tag, you provide the tag key and the tag value. Each tag key can contain up to 128 characters. Each tag value can contain up to 256 characters.
        public let tags: [String: String]

        public init(resourceArn: String, tags: [String: String]) {
            self.resourceArn = resourceArn
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:aws[-\\w]{0,10}?:detective:[-\\w]{2,20}?:\\d{12}?:graph:[abcdef\\d]{32}?$")
            try self.tags.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.key, name: "tags.key", parent: name, pattern: "^(?!aws:)[a-zA-Z+-=._:/]+$")
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 50)
            try self.validate(self.tags, name: "tags", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case tags = "Tags"
        }
    }

    public struct TagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct TimestampForCollection: AWSDecodableShape {
        /// The data and time when data collection began for a source package. The value is an ISO8601 formatted string. For example, 2021-08-18T16:35:56.284Z.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var timestamp: Date?

        public init(timestamp: Date? = nil) {
            self.timestamp = timestamp
        }

        private enum CodingKeys: String, CodingKey {
            case timestamp = "Timestamp"
        }
    }

    public struct UnprocessedAccount: AWSDecodableShape {
        /// The Amazon Web Services account identifier of the member account that was not processed.
        public let accountId: String?
        /// The reason that the member account request could not be processed.
        public let reason: String?

        public init(accountId: String? = nil, reason: String? = nil) {
            self.accountId = accountId
            self.reason = reason
        }

        private enum CodingKeys: String, CodingKey {
            case accountId = "AccountId"
            case reason = "Reason"
        }
    }

    public struct UnprocessedGraph: AWSDecodableShape {
        /// The ARN of the organization behavior graph.
        public let graphArn: String?
        /// The reason data source package information could not be processed for a behavior graph.
        public let reason: String?

        public init(graphArn: String? = nil, reason: String? = nil) {
            self.graphArn = graphArn
            self.reason = reason
        }

        private enum CodingKeys: String, CodingKey {
            case graphArn = "GraphArn"
            case reason = "Reason"
        }
    }

    public struct UntagResourceRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "resourceArn", location: .uri("ResourceArn")),
            AWSMemberEncoding(label: "tagKeys", location: .querystring("tagKeys"))
        ]

        /// The ARN of the behavior graph to remove the tags from.
        public let resourceArn: String
        /// The tag keys of the tags to remove from the behavior graph. You can remove up to 50 tags at a time.
        public let tagKeys: [String]

        public init(resourceArn: String, tagKeys: [String]) {
            self.resourceArn = resourceArn
            self.tagKeys = tagKeys
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:aws[-\\w]{0,10}?:detective:[-\\w]{2,20}?:\\d{12}?:graph:[abcdef\\d]{32}?$")
            try self.tagKeys.forEach {
                try validate($0, name: "tagKeys[]", parent: name, max: 128)
                try validate($0, name: "tagKeys[]", parent: name, min: 1)
                try validate($0, name: "tagKeys[]", parent: name, pattern: "^(?!aws:)[a-zA-Z+-=._:/]+$")
            }
            try self.validate(self.tagKeys, name: "tagKeys", parent: name, max: 50)
            try self.validate(self.tagKeys, name: "tagKeys", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct UntagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateDatasourcePackagesRequest: AWSEncodableShape {
        /// The data source package start for the behavior graph.
        public let datasourcePackages: [DatasourcePackage]
        /// The ARN of the behavior graph.
        public let graphArn: String

        public init(datasourcePackages: [DatasourcePackage], graphArn: String) {
            self.datasourcePackages = datasourcePackages
            self.graphArn = graphArn
        }

        public func validate(name: String) throws {
            try self.validate(self.datasourcePackages, name: "datasourcePackages", parent: name, max: 25)
            try self.validate(self.datasourcePackages, name: "datasourcePackages", parent: name, min: 1)
            try self.validate(self.graphArn, name: "graphArn", parent: name, pattern: "^arn:aws[-\\w]{0,10}?:detective:[-\\w]{2,20}?:\\d{12}?:graph:[abcdef\\d]{32}?$")
        }

        private enum CodingKeys: String, CodingKey {
            case datasourcePackages = "DatasourcePackages"
            case graphArn = "GraphArn"
        }
    }

    public struct UpdateOrganizationConfigurationRequest: AWSEncodableShape {
        /// Indicates whether to automatically enable new organization accounts as member accounts in the organization behavior graph.
        public let autoEnable: Bool?
        /// The ARN of the organization behavior graph.
        public let graphArn: String

        public init(autoEnable: Bool? = nil, graphArn: String) {
            self.autoEnable = autoEnable
            self.graphArn = graphArn
        }

        public func validate(name: String) throws {
            try self.validate(self.graphArn, name: "graphArn", parent: name, pattern: "^arn:aws[-\\w]{0,10}?:detective:[-\\w]{2,20}?:\\d{12}?:graph:[abcdef\\d]{32}?$")
        }

        private enum CodingKeys: String, CodingKey {
            case autoEnable = "AutoEnable"
            case graphArn = "GraphArn"
        }
    }
}

// MARK: - Errors

/// Error enum for Detective
public struct DetectiveErrorType: AWSErrorType {
    enum Code: String {
        case accessDeniedException = "AccessDeniedException"
        case conflictException = "ConflictException"
        case internalServerException = "InternalServerException"
        case resourceNotFoundException = "ResourceNotFoundException"
        case serviceQuotaExceededException = "ServiceQuotaExceededException"
        case tooManyRequestsException = "TooManyRequestsException"
        case validationException = "ValidationException"
    }

    private let error: Code
    public let context: AWSErrorContext?

    /// initialize Detective
    public init?(errorCode: String, context: AWSErrorContext) {
        guard let error = Code(rawValue: errorCode) else { return nil }
        self.error = error
        self.context = context
    }

    internal init(_ error: Code) {
        self.error = error
        self.context = nil
    }

    /// return error code string
    public var errorCode: String { self.error.rawValue }

    /// The request issuer does not have permission to access this resource or perform this operation.
    public static var accessDeniedException: Self { .init(.accessDeniedException) }
    /// The request attempted an invalid action.
    public static var conflictException: Self { .init(.conflictException) }
    /// The request was valid but failed because of a problem with the service.
    public static var internalServerException: Self { .init(.internalServerException) }
    /// The request refers to a nonexistent resource.
    public static var resourceNotFoundException: Self { .init(.resourceNotFoundException) }
    /// This request cannot be completed for one of the following reasons.   The request would cause the number of member accounts in the behavior graph to exceed the maximum allowed. A behavior graph cannot have more than 1200 member accounts.   The request would cause the data rate for the behavior graph to exceed the maximum allowed.   Detective is unable to verify the data rate for the member account. This is usually because the member account is not enrolled in Amazon GuardDuty.
    public static var serviceQuotaExceededException: Self { .init(.serviceQuotaExceededException) }
    /// The request cannot be completed because too many other requests are occurring at the same time.
    public static var tooManyRequestsException: Self { .init(.tooManyRequestsException) }
    /// The request parameters are invalid.
    public static var validationException: Self { .init(.validationException) }
}

extension DetectiveErrorType: Equatable {
    public static func == (lhs: DetectiveErrorType, rhs: DetectiveErrorType) -> Bool {
        lhs.error == rhs.error
    }
}

extension DetectiveErrorType: CustomStringConvertible {
    public var description: String {
        return "\(self.error.rawValue): \(self.message ?? "")"
    }
}
